<?php
include_once('php/includes/definer.php');
include_once('php/checkers/login.checker.php');
//borrar temporales
foreach(glob(INC.'content/tmp/home/*') as $image) {
    @unlink($image);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Chatarra - Administrador</title>
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/bootstrap.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/bootstrap-responsive.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/jquery-ui-1.8.23.custom.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/jquery.fileupload-ui.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/colorbox.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo(URL); ?>admin/css/estilos.css" media="screen" />
<script src="<?php echo(URL); ?>admin/php/includes/definer.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery-ui.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/bootstrap.min.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/tmpl.min.js"></script>
<script src="<?php echo(URL); ?>admin/js/load-image.min.js"></script>
<script src="<?php echo(URL); ?>admin/js/canvas-to-blob.min.js"></script>
<script src="<?php echo(URL); ?>admin/js/bootstrap-image-gallery.min.js"></script>
<script src="<?php echo(URL); ?>admin/js/jquery-file-upload/jquery.iframe-transport.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery-file-upload/jquery.fileupload.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery-file-upload/jquery.fileupload-fp.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery-file-upload/jquery.fileupload-ui.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/jquery.colorbox.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/imagesFrame.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/admin.js" type="text/javascript"></script>
<script src="<?php echo(URL); ?>admin/js/home.js" type="text/javascript"></script>
</head>
<body>
<div id="contenido">
<div class="container" style="margin: 0 auto">    
<?php include_once('tpl/header.html'); ?>
    <div class="row-fluid">
        <?php include_once('tpl/nav.html'); ?>
        <?php include_once('php/printers/home.printer.php'); ?>
    </div>
</div>
    <?php include_once('tpl/footer.html'); ?>
</div>
<?php include_once('tpl/loader.html'); ?>
<!-- modal-gallery is the modal dialog used for the image gallery -->
<div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
    <div class="modal-header">
        <a class="close" data-dismiss="modal">&times;</a>
        <h3 class="modal-title"></h3>
    </div>
    <div class="modal-body"><div class="modal-image"></div></div>
    <div class="modal-footer">
        <a class="btn modal-download" target="_blank">
            <i class="icon-download"></i>
            <span>Download</span>
        </a>
        <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
            <i class="icon-play icon-white"></i>
            <span>Slideshow</span>
        </a>
        <a class="btn btn-info modal-prev">
            <i class="icon-arrow-left icon-white"></i>
            <span>Previous</span>
        </a>
        <a class="btn btn-primary modal-next">
            <span>Next</span>
            <i class="icon-arrow-right icon-white"></i>
        </a>
    </div>
</div>
<!-- The template to display files available for upload -->

<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<li class="template-upload fade">
    <div class="row-fluid">
        <div class="preview span3"><span class="fade"></span></div>
        <div class="name span4"><span>{%=file.name%}</span></div>
        {% if (file.error) { %}
            <div class="error span5"><span class="label label-important">Error</span> {%=file.error%}</div>
        {% } else if (o.files.valid && !i) { %}
            <div class="span5">
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
            </div>
        {% } else { %}
            <p>Caso inesperado</p>
        {% } %}
    </div>
</li>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <li class="template-download fade" id="item{%=file.nombre%}" data-nombre="{%=file.nombre%}"  data-extension="{%=file.extension%}">
        <div class="row-fluid">
            {% if (file.error) { %}
                <div class="name span5"><p>{%=file.name%}<p></div>
                <div class="error span5"><p><span class="label label-important">Error</span> Ocurri&oacute; un error, borr&eacute; la imagen y vuelva a intentarlo</p></div>
                <div class="span2 borrar">
                    <a class="btn btn-danger borrarError"}>
                            <i class="icon-trash icon-white"></i>
                        <span>Borrar</span>
                    </a>
                </div>
            {% } else { %}
                <div class="preview span2">
                    {% if (file.galerry_url) { %}
                        <img class="recortable" id="thumbnail{%=file.nombre%}" src="{%=file.galerry_url%}">
                    {% } %}
                </div>
                <div class="name span8">{%=file.nombre%}.{%=file.extension%}</div>
                <div class="span2">
                    <a class="btn btn-danger borrarImagen" data-carpeta="tmp/home/" data-src="{%=file.nombre%}.{%=file.extension%}">
                            <i class="icon-trash icon-white"></i>
                        <span>Borrar</span>
                    </a>
                </div>
            {% } %}
        </div>
    </li>
{% } %}
</body>
</html>